package ordena1;

public class SelectionSort {

	public void selection(int[] v) {
		   int index_min,
		       aux;
		 
		   for (int i=0; i<v.length; i++) {
		       index_min = i;
		       for (int j=i+1; j<v.length; j++) {
		          if (v[j]<v[index_min]) {
		             index_min=j;
		          }
		       }
		       if(index_min != i){
		         aux = v[index_min];
		         v[index_min] = v[i];
		         v[i] = aux;
		       }
		 
		   }
		}

}
